package cn.bctools.mail.service.impl;


import cn.bctools.mail.entity.JamesUser;
import cn.bctools.mail.mapper.JamesUserMapper;
import cn.bctools.mail.service.IJamesUserService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import java.util.Collection;

/**
 * 【请填写功能名称】Service业务层处理
 *
 * @author zk
 * @date 2025-06-26
 */
@RequiredArgsConstructor
@Service
public class JamesUserServiceImpl implements IJamesUserService {

    private final JamesUserMapper baseMapper;

    @Override
    public List<JamesUser> all() {
        return baseMapper.selectList(Wrappers.lambdaQuery());
    }

    @Override
    public JamesUser queryByUserName(String userName) {
        LambdaQueryWrapper<JamesUser> wrapper = Wrappers.lambdaQuery();
        wrapper.eq(JamesUser:: getUserName, userName);
        JamesUser jamesUser = baseMapper.selectOne(wrapper);
        return jamesUser;
    }

    @Override
    public Boolean insert(JamesUser jamesUser) {
        return baseMapper.insert(jamesUser) > 0;
    }

    @Override
    public Boolean update(JamesUser jamesUser) {
        return null;
    }

    @Override
    public Boolean delete(String userName) {
        return null;
    }
}
